home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / NETPROG.ZIP;1 / NETPROG.TAR / fd.s5 / sendfile.c < prev   
Encoding:
C/C++ Source or Header  |  1989-12-17  |  363 b   |  19 lines

  1. /*
  2.  * Pass a file descriptor to another process.
  3.  * Return 0 if OK, otherwise return the errno value from the I_SENDFD ioctl.
  4.  */
  5.  
  6. #include    <sys/types.h>
  7. #include    <stropts.h>
  8.  
  9. int
  10. sendfile(strfd, fd)
  11. int    strfd;        /* stream pipe to pass descriptor on */
  12. int    fd;        /* the actual fd value to pass */
  13. {
  14.     if (ioctl(strfd, I_SENDFD, fd) < 0)
  15.         return(-1);
  16.  
  17.     return(0);
  18. }
  19.